package com.aaa.book_mall.controller;

import com.aaa.book_mall.util.MsgUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 发送短信
 * @ClassName: SendMsgController
 * @Author: fengyun
 * @Date: 2021/2/21 20:50
 * @Version: 1.0
 */
@RestController
@RequestMapping("/sendMsg")
public class SendMsgController {

    @RequestMapping("/duanxin")
    public Map sendduanxin(String phoneNumber,HttpServletRequest request){
        System.out.println("/duanxin");
        System.out.println(phoneNumber);
//      发送短信，获取验证码
//        int i = MsgUtils.sendMsg(phoneNumber,request);
        HashMap<String, Object> map = new HashMap<>();
        if(1==1){
            map.put("code",200);
            map.put("msg","发送成功");
        }else {
            map.put("code",300);
            map.put("msg","发送失败，请重新发送");
        }
        return map;
    }
}
